package com.tanhua.server.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.server.mapper.UserInfoMapper;
import com.tanhua.server.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/***
 * 在数据库中查找对应的个人信息
 */
@Service
public class UserInfoService {
    @Autowired
    private UserInfoMapper userInfoMapper;
    public UserInfo queryUserInfoByUserId(Long userId) {
        QueryWrapper<UserInfo> wrapper=new QueryWrapper<>();
        wrapper.eq("user_id",userId );
      return   this.userInfoMapper.selectOne(wrapper);
    }


    public List<UserInfo> queryUserInfoList(QueryWrapper<UserInfo> queryWrapper) {
        List<UserInfo> userInfoList = this.userInfoMapper.selectList(queryWrapper);
        return userInfoList;
    }
}
